<?php
namespace app\index\controller;

use think\Controller;
use app\index\model\Draw as Draws;
class Draw extends Comm
{
    public function index()
    {
        $draws=new Draws();
        $res= $draws->AllData();
        return view('index',['res'=>$res,'i'=>1]);
    }
    //同意提现申请
    public function add(){
        $id=input('id');
        $draws=new Draws();
        $res=$draws->agrees($id);
        if($res)
            $this->success('操作成功！','index/draw/index');
        else
            $this->error('操作失败！','index/draw/index');
    }
    //驳回提前申请
    public function del(){
        $id=input('id');
        $draws=new Draws();
        $res= $draws->reject($id);
        if($res)
            $this->success('操作成功！','index/draw/index');
        else
            $this->error('操作失败！','index/draw/index');
    }
}
